<div class="loader"></div>
@if(Session::has('message'))
	<div class="alert alert-success"><i class="fa fa-check-circle"></i> {{ Session::get('message') }}
		<button type="button" class="close" data-dismiss="alert">&times;</button>
	</div>
@endif
<h3>{{ $title }} with ID# {{ $result->id }}</h3>
<div class="row">
	<a class="btn btn-info pull-right edit" href="{{ URL::to($base, array($result->id, 'edit')) }}"><i class="fa fa-pencil"></i> {{ $text_edit }}</a>
</div>
<hr />
<div class="form-group">
	{{ Form::label('name', $form_name) }}
	{{ $result->name }}
	<span class="error text-danger" id="error_name"></span>
</div>

<div class="form-group">
	{{ Form::label('level', $form_level) }}
	{{ ucwords($result->level) }}
</div>	

<div class="form-group">
	{{ Form::label('name', $form_permission) }}
	<table class="table table-bordered">
		<thead>
			<tr>
				<th>{{ $text_module }}</th>
				<th>{{ $text_route }}</th>
				<th>{{ $text_icon }}</th>
				<th>{{ $text_create }}</th>
				<th>{{ $text_read }}</th>
				<th>{{ $text_update }}</th>
				<th>{{ $text_delete }}</th>
			</tr>
		</thead>
		<tbody id="user_profile">
		@foreach( $result['modules'] as $index=>$module )
			<tr>
				<td>{{ $module['title'] }}</td>
				<td>{{ $module['route'] }}</td>
				<td><i class="fa {{ $module['icon'] ? $module['icon'] : ''}} "></i></td>
				<td align="center"><i class="fa {{ $module['create'] ? 'fa-check' : 'fa-close'}} "></i></td>
				<td align="center"><i class="fa {{ $module['read'] ? 'fa-check' : 'fa-close'}} "></i></td>
				<td align="center"><i class="fa {{ $module['update'] ? 'fa-check' : 'fa-close'}} "></i></td>
				<td align="center"><i class="fa {{ $module['delete'] ? 'fa-check' : 'fa-close'}} "></i></td>
			</tr>
		@endforeach
		</tbody>
	</table>
</div>